package com.oig.sys.msg.constants;

public class MsgEnums {

    /**
     * 01-正在生成文件
     * 02-文件已生成
     * 03-已下载
     */
    public enum ExportTaskStatus{
        CREATE_FILE("01","正在生成文件"),
        FILE_OK("02","文件已生成"),
        FILE_DOWN("03","已下载"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        ExportTaskStatus(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (ExportTaskStatus enumItems : ExportTaskStatus.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }

    public enum MsgSource{
        SYS_NOTICE("01", "系统消息"),
        OPT("02", "手工录入"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        MsgSource(String code, String name){
            this.code = code;
            this.name = name;
        }
    }

    /**
     * 01-定向消息 02-群消息
     */
    public enum MsgType{
        TARGET("01", "定向消息"),
        GROUP("02", "群消息"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        MsgType(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (MsgType enumItems : MsgType.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }

    /**
     * 01-系统消息 02-公告通知
     */
    public enum MsgStatus{
        INIT("01","草拟"),
        CHECKING("02","待审核"),
        UN_ENABLE("03","不通过"),
        OK("04","正常"),
        DEL("05","删除"),
        PUBLISH("09","已发布"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        MsgStatus(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (MsgStatus enumItems : MsgStatus.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }

    /**
     * 00-所有用户 （用户下属所有机构下的用户） 01-租户全员 02-部门 03-人员
     */
    public enum ReceiverType{
        ALL("00", "所有用户"),
        TENANT("01", "租户全员"),
        DEPT("02", "部门"),
        USER("03", "人员"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        ReceiverType(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (ReceiverType enumItems : ReceiverType.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }


    /**
     * 00-未开始 01-待发送 02-已发送
     */
    public enum SendStatus{
        NO_DO("00", "未开始"),
        READY("01", "待发送"),
        SEND("02", "已发送"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        SendStatus(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (SendStatus enumItems : SendStatus.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }

    /**
     * 01-未读 02-已读
     */
    public enum ReceiverMsgStatus{
        UN_READ("01", "未读"),
        READ("02", "已读"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        ReceiverMsgStatus(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (ReceiverMsgStatus enumItems : ReceiverMsgStatus.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }



    /**
     * 任务状态 00-未开始 01-进行中 02-已完成
     */
    public enum TaskStatus{
        INIT("00", "未开始"),
        DOING("01", "进行中"),
        REFUSE("02", "已拒绝"),
        FINISH("03","已完成"),
        CLOSE("04","已关闭"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        TaskStatus(String code, String name){
            this.code = code;
            this.name = name;
        }
    }

    /**
     * 任务优先级 0-低 1-中 2-高
     */
    public enum TaskPriority{
        LOW("0", "低"),
        MID("1", "中"),
        HIG("2", "高"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        TaskPriority(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (TaskPriority enumItems : TaskPriority.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }

    /**
     * 任务重要程度 0-不重要 1-一般 2-重要
     */
    public enum TaskLevel{
        LOW("0", "不重要"),
        MID("1", "一般"),
        HIG("2", "重要"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        TaskLevel(String code, String name){
            this.code = code;
            this.name = name;
        }

        public static boolean validCode(String code) {
            for (TaskLevel enumItems : TaskLevel.values()) {
                if (enumItems.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }


    /**
     * 任务日志类型 0-创建 1-更新  2-指派 3-备注 4-重新打开 5-拒绝 6-完成 7-关闭
     */
    public enum TaskLogType{
        CREATE("0", "创建"),
        UPDATE("1", "更新"),
        ASSIGN("2", "指派"),
        REMARK("3", "备注"),
        OPEN("4", "重新打开"),
        REFUSE("5", "拒绝"),
        FINISH("6", "完成"),
        CLOSE("7", "关闭"),
        ;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }

        TaskLogType(String code, String name){
            this.code = code;
            this.name = name;
        }
    }

    /**
     * 渠道类型
     */
    public enum MsgChannel{
        ENTERPRISE_WE_CHAT("04", "企业微信应用机器人", "01"),
        ENTERPRISE_WE_CHAT_ROBOT("04", "企业微信群机器人", "02"),
        FEI_SHU("05", "飞书应用机器人","01"),
        FEI_SHU_ROBOT("05", "飞书群机器人", "02"),
        ;
        private final String code;
        private final String name;
        private final String noticeTypeCode;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }
        public String getNoticeTypeCode() {
            return noticeTypeCode;
        }


        MsgChannel(String code, String name, String noticeTypeCode){
            this.code = code;
            this.name = name;
            this.noticeTypeCode = noticeTypeCode;
        }

        public static boolean validCode(String code) {
            for (MsgChannel enumItem : MsgChannel.values()) {
                if (enumItem.getCode().equals(code)) {
                    return true;
                }
            }
            return false;
        }
    }


}
